package day04;

import java.util.Scanner;

public class DayHomeWork04 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("~~~~~~~~~~~~~~111~~~~~~~~~~~");
        System.out.println("请选择功能: 1.取款 2.存款 3.查询余额 0.退卡");
        int command = scan.nextInt();
        switch (command) {
            case 1:
                System.out.println("取款");
                break;
            case 2:
                System.out.println("存款");
                break;
            case 3:
                System.out.println("查询余额");
                break;
            case 4:
                System.out.println("退卡");
                break;
            default:
                System.out.println("输入错误");
        }
        System.out.println("~~~~~~~~~~~~~~2~~~~~~~~~~~");

        int num = (int) (Math.random() * 1000);
        System.out.println("输入猜的数字：");
        int guess = scan.nextInt();
        while (guess != num) {
            if (guess < num) {
                System.out.println("猜小了");
            } else {
                System.out.println("猜大了");
            }
            guess = scan.nextInt();
        }
        System.out.println("恭喜你猜中了!");

        System.out.println("~~~~~~~~~~~~~~3~~~~~~~~~~~");
        int num1 = (int) (Math.random() * 1000);
        int guess1;
        do {
            System.out.println("猜数do while版 输入猜的数字：");
            guess1 = scan.nextInt();
            if (num1 < guess1) {
                System.out.println("猜大了");
            } else if (num1 > guess1) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜你猜中了！");
            }
        } while (num1 != guess1);

        System.out.println("~~~~~~~~~~~~~~4~~~~~~~~~~~");

        for (int i = 0; i < 5; ++i) {
            System.out.println("行动是成功的阶梯");

        }

        for (int i = 1; i <= 9; ++i) {
            System.out.println(i + "*9=" + i * 9);
        }

        for (int i = 1; i <= 9; i += 2) {
            System.out.println(i + "*9=" + i * 9);
        }

        for (int i = 9; i >= 1; --i) {
            System.out.println(i + "*9=" + i * 9);
        }
        int sum = 0;
        for (int i = 1; i <= 100; ++i) {
            sum += i;
        }
        System.out.println(sum);
        System.out.println("~~~~~~~~~~~~~~5~~~~~~~~~~");
        for (int i = 1; i <= 9; i++) {
            if (i == 4) {
                break;
            }
            System.out.println(i + "*9=" + i * 9);
        }

        for (int i = 1; i <= 9; ++i) {
            if (i % 3 == 0) {
                continue;
            }
            System.out.println(i + "*9=" + i * 9);
        }
    }
}
